<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>  
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
 	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.4.4.min.js"></script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	function yj(){
	
		var shuzi1=$('#a').val();
		var	shuzi2=$('#b').val();
	$.ajax({
		url:'${pageContext.request.contextPath}/modelPages/jisuan',
		data:{sz1:shuzi1,sz2:shuzi2},
		type:'post',
		success:function(data){
			alert("请求成功！");
			$("#c").html(data);
		},
		fail:function(data){
			alert("请求失败！");
		  }
	});	
}
</script>
</head>
<body>
	<h1>计算</h1>
	数字1：<input id='a' type="text"/><br/><br/>
	数字2：<input id='b' type="text"/><br/><br/>
	结果：<h7 id='c'></h7>
	<br/>
	<input  type="button" value='提交' onclick="yj()"/>
</body>
</html>